<%@ include file="/WEB-INF/tiles/include.jsp"%>

<script type="text/javascript">
	$(document).ready(function($) {
		$(".facebox_edit").click(function(){
			var idEdit = $(this).attr("title");
			//alert("ID :: "+idEdit);
			$.wis.util.doEdit(idEdit);
		});

		$("table.cTag>thead>tr>th>a").each(function(){
			$(this).attr("class","ahrefDT");
		});
		$("table.cTag>thead>tr>th").find(".ahrefDT").each(function(){
			$(this).click(function() {
				linkData = $(this).attr("href");
				qryStrDT = linkData.split("?",2)[1];
				qryStrDT = qryStrDT.split("#index",1);
				$.wis.util.doSortDisplayTag(""+qryStrDT);
				return false;
			});
		});
	});
</script>

<a name="index"/>
<form:form id="mainForm" commandName="commandExchangeRate" method="post" action="${pageContext.request.contextPath}/basic/administrative/exchangeRate">
	<form:hidden path="pgIndex"/>
	<form:hidden path="pgRows"/>
	<form:hidden path="pgTotal"/>

<fieldset class="fieldset">
<table class="navigator">
<tr>
	<td align="left">
		<!-- 
		<span class="button"><a href="#modalbox" id="modalbox_del"><spring:message code="label.delete"/></a></span>&nbsp;
		<span class="button"><a href="#facebox" id="facebox_new" >&nbsp;<spring:message code="label.add"/>&nbsp;</a></span>&nbsp;
		 -->
		 &nbsp;
	</td>
	<td align="right"><div id="pageNavigator"></div></td>
</tr>
</table>
<c:if test="${not empty commandExchangeRate.data}">
<display:table id="row" class="cTag" name="commandExchangeRate.data" requestURI="#index">
	<display:column titleKey="label.currencySrc" sortable="true">
		<c:forEach items="${commandExchangeRate.currList}" var="currency" varStatus="currencySt">
			<c:if test="${row.srcCurrId == currency.stValue}">
				${currency.stLabel}
			</c:if>
		</c:forEach>
	</display:column>
	<display:column titleKey="label.currencyDest" sortable="true">
		<c:forEach items="${commandExchangeRate.currList}" var="currency" varStatus="currencySt">
			<c:if test="${row.destCurrId == currency.stValue}">
				${currency.stLabel}
			</c:if>
		</c:forEach>
	</display:column>
	<display:column titleKey="label.rate" sortable="true" property="rate" />
	<display:column titleKey="label.commission" property="commission"
		sortable="true" />
	<display:column titleKey="label.createBy" property="createdby"
		sortable="true" />
	<display:column titleKey="label.createDt" property="createddate"
		sortable="true" />
	<display:column title="Action">
	<center>
		<a title="${row.id}" href="#facebox_edit" class="facebox_edit"><spring:message code="label.edit"/></a>&nbsp;
		<!-- 
		<a title="${row.id}" href="#modalbox_singleDel" class="modalbox_singleDel"><spring:message code="label.delete"/></a>
		 -->
	</center>
	</display:column>
</display:table>
</c:if>
</fieldset>

</form:form>
